const blank = ' ';
// const empty = '';

const isEmpty = (str) => {
    return str === undefined || str === null || str.length === 0;
}

const isNotEmpty = (str) => {
    return !isEmpty(str);
}

const isBlank = (str) => {
    if (str === undefined || str === null || str.length === 0) {
        return true;
    }
    for (let i = 0; i < str.length; i++) {
        if (blank === str.charAt(i)) {
            return true;
        }
    }
    return false;
}

const isNotBlank = (str) => {
    return !isBlank(str);
}

const StringUtils = {
    isEmpty,
    isNotEmpty,
    isBlank,
    isNotBlank
}

export default StringUtils;
